package com.zlx.module_base.base_util;

import com.blankj.utilcode.util.CacheDiskUtils;
import com.blankj.utilcode.util.SPUtils;
import com.jess.arms.base.delegate.sys.LoginStateUtil;
import com.jess.arms.base.delegate.sys.SysInfo;
import com.jess.arms.database.MMkvHelper;
import com.zlx.module_base.constant.BaseConstant;

/**
 * copyright (C), 2022, 运达科技有限公司
 * fileName SessionUtils
 *
 * @author 王玺权
 * date 2022-04-11 18:42
 * description session相关 todo 后期放入base包中
 * history
 */
public class SessionUtils {
    /**
     * 清除session
     */
    public static void clearSession(){
        SPUtils.getInstance().remove(BaseConstant.SP_HAS_LOGIN);
        CacheDiskUtils.getInstance()
                .remove(BaseConstant.CACHE_PSERSONINFO);
        LoginStateUtil.clearOkhttpCookieCache();
        SysInfo.cookieStore.clear();
//        CacheDiskUtils.getInstance().clear();
        MMkvHelper.getInstance().logout();
    }
}
